package com.dc.datacollect.entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

/**
 * 收集方
 * @TableName collector
 */
@Data
public class Collector implements Serializable {
    /**
     * 收集者id
     */
    private Long id;
    /**
     * 收集者头像图片URL
     */
    private String avatar;
    /**
     * 收集者性别
     */
    private Short sex;

    /**
     * 用户名
     */
    private String username;

    /**
     * 收集者登录密码
     */
    private String password;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 通知邮箱
     */
    private String email;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Collector collector = (Collector) o;
        return Objects.equals(id, collector.id) && Objects.equals(avatar, collector.avatar) && Objects.equals(sex, collector.sex) && Objects.equals(username, collector.username) && Objects.equals(password, collector.password) && Objects.equals(nickname, collector.nickname) && Objects.equals(email, collector.email) && Objects.equals(gmtCreate, collector.gmtCreate) && Objects.equals(gmtModified, collector.gmtModified);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, avatar, sex, username, password, nickname, email, gmtCreate, gmtModified);
    }
}